package com.noah.bee.core.util;

import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;

/**
 * @author 吴镇
 * @description:
 * @createdate 2016/12/26
 */
public class InitPath2PathUtil {

    public static String initPath2Path(String path) {
        String[] paths = path.split("\\.");
        String[] initPaths = Arrays.copyOfRange(paths,0,paths.length - 2);
        return StringUtils.join(initPaths, ".");
    }

    public static void main(String[] args) {
        String s  = "com.noah.stock.XXX";
        System.out.println(InitPath2PathUtil.initPath2Path(s));
    }
}
